package spring.cloud.tasks.common.nodepaths;

import spring.cloud.tasks.common.Symbols;

public class ExecutorNodePaths {
    public static final String ROOT = Symbols.SLASH + "executors";

    private ExecutorNodePaths() {
    }


    public static String getRoot() {
        return ROOT;
    }

    public static String getExecutorSubNodePath(final String executorId) {
        return getRoot() + Symbols.SLASH + executorId;
    }

    public static String getExecutorSubNodePath(final String executorId, final String nodeName) {
        return getExecutorSubNodePath(executorId) + Symbols.SLASH + nodeName;
    }

    public static String getExecutorOwnTrafficNodePath(final String executorId) {
        return getExecutorSubNodePath(executorId, "ownTraffic");
    }

    public static String getExecutorIpNodePath(final String executorId) {
        return getExecutorSubNodePath(executorId, "ip");
    }

    public static String getExecutorRestartNodePath(final String executorId) {
        return getExecutorSubNodePath(executorId, "restart");
    }

    public static String getProcessSuccessCountNode(String executorId) {
        return getExecutorSubNodePath(executorId, "process_success_count");

    }

    public static String getProcessFailureCountNode(String executorId) {
        return getExecutorSubNodePath(executorId, "process_failure_count");
    }


}
